package main

import (
	"fmt"
	"math/rand"
	"time"
)

func main() {
	rand.NewSource(time.Now().UnixNano())
	sum := 0
	product := 1
	for i := 1; i <= 20; i++ {
		randomNum := rand.Intn(20) + 1
		fmt.Printf("生成的随机数 %d 是: %d\n", i, randomNum)

		if i%2 == 1 {
			sum += randomNum
		} else {
			product *= randomNum
		}
	}
	fmt.Println("\n单数相加的结果:", sum)
	fmt.Println("偶数相乘的结果:", product)
}
